﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace EWDTAssignment
{
    public partial class EmailUs : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void EmailUsBtn_Click(object sender, EventArgs e)
        {
            if (this.IsValid)
            {
                string title = EmailUsDDL.SelectedValue;
                string name = EmailUsNameTbx.Text;
                string contact = EmailUsContactTbx.Text;
                string email = EmailUsEaddressTbx.Text;
                string subject = EmailUsSubject.Text;
                string text = EmailUsContentTbx.Text;
                string receiver= "zhengtianyou1989@hotmail.com";
                string Content="From "+title+name+"\n"+"Contact:"+contact+"\n"+"Email:"+email+"\n\n"+text;
                if (subject == null)
                {
                    subject = "No Subject";
                }
                App_Code.Email.sentEmail(receiver,subject,Content);
            }
        }
    }
}